/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package we.dispatcher.writer;

import we.dispatcher.CPacketWriter;

/**
 *
 * @author trungdv2
 */
public class TemplateWriterProcessor implements IWritingProcessor
{

    @Override
    public void write(CPacketWriter writer, Object obj)
    {       
        Class _class = obj.getClass();
        if (_class == String.class) {
            writer.PutString((String) obj);
        } else if (_class == Byte.class) {
            writer.buffer().get();
        } else if (_class == Integer.class) {
            writer.buffer().getInt();
        } else if (_class == Long.class) {
            writer.buffer().getLong();
        } else if (_class == Short.class) {
            writer.buffer().getShort();
        }
    }
}
